package com.smasher.update.entity

import kotlinx.serialization.InternalSerializationApi
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@InternalSerializationApi
@Serializable
data class BaseDataContainer<T>(
    @SerialName(value = "success")
    var isSuccess: Boolean = false,
    @SerialName(value = "code")
    var code: Int = 0,
    @SerialName(value = "msg")
    var msg: String? = null,
    @SerialName(value = "total")
    var total: Int = 0,
    @SerialName(value = "data")
    var data: T? = null,
    @SerialName(value = "time")
    var time: String = ""
) {

    companion object {
        private fun indentString(ori: String, tabString: String): String {
            val builder = StringBuilder()
            builder.append(ori)
            builder.insert(0, tabString)
            return builder.toString()
        }
    }
}
